<div class="box-body uk-padding-small">
    <form class="dux-form uk-form" action="{url('', ['action' => $action])}" method="post" data-dux="form-bind" data-advanced="false">
        <div class="uk-form-group">
            <label class="uk-form-label">退款类型</label>
            <div class="uk-form-controls uk-form-controls-text">
                <div>
                <label>
                    <input type="radio" name="type" value="0" data-price="{$info.price_total}" checked> 仅退款
                </label>
                <label>
                    <input type="radio" name="type" value="1" data-price="{$info.price_total}"> 退款退货
                </label>
                <!--if{$orderRefund}-->
                <label>
                    <input type="radio" name="type" value="2" data-price="{$orderInfo.pay_price}"> 整单退
                </label>
                <!--{/if}-->
                </div>
            </div>
        </div>
        <div class="uk-form-group">
            <label class="uk-form-label">退款原因</label>
            <div class="uk-form-controls uk-form-controls-text">
                <select name="cause">
                    <option value="">请选择原因</option>
                    <!--loop{$causeList as $vo}-->
                    <option value="{$vo}">{$vo}</option>
                    <!--{/loop}-->
                </select>
            </div>
        </div>
        <div class="uk-form-group">
            <label class="uk-form-label">商品退款 <small>(最高<span id="price">{$info.price_total}</span>)</small></label>
            <div class="uk-form-controls uk-form-controls-text">
                <input type="tel" name="price" required data-validation-message="退款金额不正确" max="{intval($info.price_total)}" value="{$info.price_total}">
            </div>
        </div>
        <div class="uk-form-group">
            <label class="uk-form-label">运费退款 <small>(最高<span>{$deliveryPrice}</span>)</small></label>
            <div class="uk-form-controls uk-form-controls-text">
                <input type="tel" name="delivery_price" required data-validation-message="退款金额不正确" value="{$deliveryPrice}">
            </div>
        </div>
        <div class="uk-form-group">
            <label class="uk-form-label">退款描述 (选填)</label>
            <div class="uk-form-controls uk-form-controls-text">
                <textarea rows="3" placeholder="请填写退款描述,200字以内" name="content"></textarea>
            </div>
        </div>
        <div class="uk-form-group">
            <label class="uk-form-label">凭证 (选填)</label>
            <div class="uk-form-controls uk-form-controls-text">
                <ul class="dux-upload-list uk-clearfix">
                    <span id="images"></span>
                    <li>
                        <a href="javascript:;" class="add-img" data-dux="form-images" data-img-warp="#images"
                           data-img-name="images" data-num="5" data-tpl-el="#tpl" data-url="{url('member/Upload/index')}"></a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="uk-form-group">
            <div class="uk-form-controls uk-form-controls-text">
                <input type="hidden" name="id" value="{$id}">
                <button type="submit" class="uk-button uk-button-primary uk-button-block">提交申请</button>
            </div>
        </div>
    </form>
</div>
<script type="text/html" id="tpl">
    <li>
        <a href="{{ d.data.url }}" target="_blank"><img src="{{ d.data.url }}"></a>
        <i class="close">×</i>
        <input type="hidden" name="{{ d.name }}[]" value="{{ d.data.url }}">
    </li>
</script>
<script>
    Do('base', function () {
        $('input[name=type]').change(function () {
            var price = $(this).data('price');
            var type = $(this).val();
            $('#price').text(price);
            $('input[name=price]').val(price);
            if(type == 2) {
                $('input[name=price]').attr('disabled', true);
                $('input[name=delivery_price]').attr('disabled', true);
            }else {
                $('input[name=price]').attr('disabled', false);
                $('input[name=delivery_price]').attr('disabled', false);
            }
        });
    });
</script>